]> dgit.raspbian.org Git - gnome-shell.git/commit
windowPreview: Ignore leave events after being destroyed
authorSebastian Keller <skeller@gnome.org>
Mon, 17 Apr 2023 11:38:23 +0000 (13:38 +0200)
committerMarge Bot <marge-bot@gnome.org>
Tue, 18 Apr 2023 19:44:20 +0000 (19:44 +0000)
commit4bbf6d497d34793693e5ac24fbe23854b481002b
tree5114de05c6a37b0925f9fa3dd56b7d8246b6f52f
parent8bf06bfc9f87c665959e1ff3240f227e5cf224df
windowPreview: Ignore leave events after being destroyed

When a WindowPreview is being destroyed, the class default handler for
the `destroy` signal is responsible for destroying its child actors.
This happens after the emission of the `destroy` signal, i.e. after
`WindowPreview::_onDestroy()` has been run.

The destruction of the WindowPreview's child actors now triggers a
re-pick, but due to WindowPreview having already being marked as
`CLUTTER_IN_DESTRUCTION`, it will not be picked, resulting in a `leave`
event if the cursor was on top of the WindowPreview at the time
`destroy()` was called on it.

So this leads to `WindowPreview::vfunc_leave_event()` being run after
`WindowPreview::_onDestroy()`, which means the idle started by the leave
event handler will not be removed and ends up accessing actors after
they have already been destroyed.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5512
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6065
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2738>
js/ui/windowPreview.js